package o;

import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;

class evv$a implements SensorEventListener {
    final /* synthetic */ evv ˎ;

    evv$a(evv o_evv) {
        this.ˎ = o_evv;
    }

    public void onSensorChanged(SensorEvent sensorEvent) {
        if (evv.ˊ(this.ˎ)) {
            evv.ˊ(this.ˎ, false);
            if (this.ˎ.ˎ()) {
                float[] fArr = sensorEvent.values;
                int i = -1;
                float f = -fArr[0];
                float f2 = -fArr[1];
                float f3 = -fArr[2];
                if (((f * f) + (f2 * f2)) * 4.0f >= f3 * f3) {
                    i = 90 - Math.round(57.29578f * ((float) Math.atan2((double) (-f2), (double) f)));
                    while (i >= 360) {
                        i -= 360;
                    }
                    while (i < 0) {
                        i += 360;
                    }
                }
                if (i != evv.ˎ(this.ˎ)) {
                    evv.ˊ(this.ˎ, i);
                    this.ˎ.ˎ(i);
                }
            }
        }
    }

    public void onAccuracyChanged(Sensor sensor, int i) {
    }
}
